function img=newimage(image_file,varargin)
% newimage: Create a new image object (not rotable)
%
% SYNTAX:
%   img = newimage(image_file,prop1,value1,...)
%   Return generated MADS.Image object img from specified image file and properties
%   This image can be used as a logo of a player P by passing it to property P.img
%   Type "newimg('')" to see available properties and their default values. 
%   
% See also NEWICON, DRAWIMAGE

%   Author: Hongbin Ma
%   Last updated: 2009-6-2 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

img=struct('type','MADS.Image',varargin{:});
[c,map]=imread(image_file);
img=set_field(img,'c',c);
img=set_field(img,'map',map);
%~ img=set_field(img,'x',linspace(0,1,size(c,1)-2));
%~ img=set_field(img,'y',linspace(1,0,size(c,2)-2));
img=set_field(img,'x',[0,1]);
img=set_field(img,'y',[1,0]);
img=set_field(img,'size',5);
img=set_field(img,'sx',1);
img=set_field(img,'sy',1);
img=set_field(img,'sz',1);
